home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / tuning / download / xteq / setup.exe / {app} / plugins / XQ Script Files 1.xpl < prev    next >
Text File  |  2001-05-04  |  3KB  |  108 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="6"
  3. "COUNT"="3"
  4. "UIPATH 1"="System\Security\Common"
  5. "UIPATH 2"="Appearance\Files&Folders\Files"
  6. "NAME"="Script Files"
  7. "LANGUAGE"="VBScript"
  8. "VERSION"="1.05"
  9. "TEXT 1"="Open *.VBS/*.VBE with Notepad when opened"
  10. "TEXT 2"="Open *.JS/*.JSE with Notepad when opened"
  11. "TEXT 3"="Open *.WSH/*.WSF with Notepad when opened"
  12. "DESCRIPTION 1"="Script files are powerful to automate common tasks but they are also a security problem. Some mad people use script files to create viruses (e.g. the "I LOVE YOU" virus in May 2000) so it's better to have a look at the files before executing them."
  13. "DESCRIPTION 2"="If the checkbox is activated, a double click on a script file will open Notepad instead of executing the script. This way, you can review the file before executing it. "
  14. "DESCRIPTION 3"="After this review, just select the file, right click and select "Open" from the appearing menu to execute the script finally."
  15. "AUTHOR"="Xteq Systems"
  16. "CONTACTURL"="http://www.xteq.com"
  17. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  18. "COMMENT 1"=" "
  19.  
  20.  
  21.  
  22.  
  23.  
  24. sDefault_a="HKCR\"
  25. sDefault_b="\Shell\@"
  26. sDefault_Value="Edit"
  27. sDefault_Edit_a="HKCR\"
  28. sDefault_Edit_b="\Shell\Edit\Command\@"
  29. sDefault_Edit_Cmd="Notepad.exe %1"
  30.  
  31. sP1a="HKCR\.VBS\@"
  32. sP1b="HKCR\.VBE\@"
  33.  
  34. sP2a="HKCR\.JS\@"
  35. sP2b="HKCR\.JSE\@"
  36.  
  37. sP3a="HKCR\.WSH\@"
  38. sP3b="HKCR\.WSF\@"
  39.  
  40. Sub Plugin_Initialize 
  41.  b1=ReadStatus(sP1a)
  42.  b2=ReadStatus(sP1b)
  43.  if b1=true and b2=true then SetUIElement 1,true
  44.  
  45.  b1=ReadStatus(sP2a)
  46.  b2=ReadStatus(sP2b)
  47.  if b1=true and b2=true then SetUIElement 2,true
  48.  
  49.  b1=ReadStatus(sP3a)
  50.  b2=ReadStatus(sP3b)
  51.  if b1=true and b2=true then SetUIElement 3,true
  52. End Sub
  53.  
  54. Sub Plugin_CheckData(ElementIndex)
  55. End Sub
  56.  
  57. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  58.  Call WriteChanges(sP1a,GetUIElement(1))
  59.  Call WriteChanges(sP1b,GetUIElement(1))
  60.  
  61.  Call WriteChanges(sP2a,GetUIElement(2))
  62.  Call WriteChanges(sP2b,GetUIElement(2))
  63.  
  64.  Call WriteChanges(sP3a,GetUIElement(3))
  65.  Call WriteChanges(sP3b,GetUIElement(3))
  66. End Sub
  67.  
  68. Sub Plugin_Terminate 
  69. End Sub
  70.  
  71.  
  72. Function ReadStatus(key)
  73.  s=RegReadValue(key)
  74.  'Debugmsg s
  75.  s=sDefault_a & s & sDefault_b
  76.  s=RegReadValue(s)
  77.  if s=sDefault_Value then
  78.     ReadStatus=true
  79.  else
  80.     ReadStatus=false
  81.  end if
  82. End Function
  83.  
  84. Sub WriteChanges(key,activated)
  85.  sPathFirst=RegReadValue(key)
  86.  'Debugmsg s
  87.  sPath=sDefault_a & sPathFirst & sDefault_b
  88.  v=RegReadValue(sPath)
  89.  
  90.  if activated=false then 'EXECUTE!
  91.     if IsEmpty(v)=false then
  92.        RegDeleteValue sPath
  93.     end if
  94.  else 'DEACTIVATE
  95.     RegWriteValue sPath,sDefault_Value,1
  96.  
  97.     'check if "EDIT" exists
  98.     sPath=sDefault_Edit_a & sPathFirst & sDefault_Edit_b
  99.     v=RegReadValue(sPath)
  100.     if IsEmpty(v) then
  101.        RegWriteValue sPath,sDefault_Edit_Cmd,1
  102.     end if
  103.  end if
  104.  
  105. End Sub
  106.  
  107.  
  108.